Skip to content

Conversation

@CarlSchwan
Copy link
Member

  • Resolves: #

Summary

TODO

  • ...

Checklist

@CarlSchwan CarlSchwan added this to the Nextcloud 33 milestone Jan 12, 2026
@CarlSchwan CarlSchwan self-assigned this Jan 12, 2026
@CarlSchwan CarlSchwan force-pushed the carl/external-storage-ipartialmountpoint branch 3 times, most recently from 209115a to 67fcb93 Compare January 12, 2026 15:45
@CarlSchwan CarlSchwan force-pushed the carl/external-storage-ipartialmountpoint branch from 67fcb93 to 3ddc49b Compare January 12, 2026 16:14
Comment on lines +180 to +200
$userId = null;
$user = null;
foreach ($mountProviderArgs as $mountProviderArg) {
if ($userId === null) {
$user = $mountProviderArg->mountInfo->getUser();
$userId = $user->getUID();
} elseif ($userId !== $mountProviderArg->mountInfo->getUser()->getUID()) {
throw new \LogicException('Mounts must belong to the same user!');
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering if we shouldn't move that check:

public function getUserMountsFromProviderByPath(
string $providerClass,
string $path,
bool $forChildren,
array $mountProviderArgs,
): array {
$provider = $this->providers[$providerClass] ?? null;
if ($provider === null) {
return [];
}
if (!is_a($providerClass, IPartialMountProvider::class, true)) {
throw new \LogicException(
'Mount provider does not support partial mounts'
);
}
/** @var IPartialMountProvider $provider */
return $provider->getMountsForPath(
$path,
$forChildren,
$mountProviderArgs,
$this->loader,
);
}

Not sure why Salvatore didn't.

@CarlSchwan CarlSchwan force-pushed the carl/external-storage-ipartialmountpoint branch 4 times, most recently from 0db2c55 to 2dfcaf7 Compare January 13, 2026 17:02
@CarlSchwan CarlSchwan force-pushed the carl/external-storage-ipartialmountpoint branch from 2dfcaf7 to b384327 Compare January 14, 2026 17:28
$builder->expr()->andX( // global mounts
$builder->expr()->eq('a.type', $builder->createNamedParameter(self::APPLICABLE_TYPE_GLOBAL, IQueryBuilder::PARAM_INT)),
$builder->expr()->isNull('a.value'),
$forChildren ? $builder->expr()->like('m.mount_point', $builder->createNamedParameter($this->connection->escapeLikeParameter($path) . '%', IQueryBuilder::PARAM_STR))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Salvatore used _% to target paths with at least one extra character. I am wondering if we should use /% to explicitly target paths that are under the provided path.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After discussion with Carl, /% needs to be carefully applied in case the path end with a /

@CarlSchwan CarlSchwan force-pushed the carl/external-storage-ipartialmountpoint branch 2 times, most recently from d8882d1 to 35159bb Compare January 16, 2026 12:29
@CarlSchwan CarlSchwan force-pushed the carl/external-storage-ipartialmountpoint branch from 35159bb to a359de3 Compare January 16, 2026 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants